<template>
    <div class="app-wrapper">
        <div class="main-container">
            <section class="app-main simple-page" style="min-height: 100%;">
                <van-toast type="loading" :mask="true" message="登录验证中..." v-model="loading" />
                <errorTips :error-message="errorMessage" v-show="errorMessage !== ''"></errorTips>
            </section>
        </div>
    </div>
</template>

<script>
import { authorizeMemberInfo } from '@/api/member/index.js'
import errorTips from '@/components/error-tips'

export default {
    name: 'AuthorizeMember',
    components: {
        errorTips
    },
    data () {
        return {
            loading: true,
            errorMessage: ''
        }
    },
    methods: {
        getData () {
            let data = this.$route.query.data
            authorizeMemberInfo(data).then((rst) => {
                this.loading = false
                if (rst.status == 0) {
                    this.$router.push({name: 'goodsList'})
                } else {
                    this.errorMessage = rst.message ? rst.message : '验证失败'
                }
            }).catch((message) => {
                this.loading = false
                this.errorMessage = '验证失败'
            })
        },
    },
    created () {
        this.getData()
    }
}
</script>

<style lang="scss">

</style>